<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="/static/shop/account/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="/static/shop/account/css/swiper.min.css"/>
    <link rel="stylesheet" href="/static/shop/account/css/LCalendar.css">
</head>
<body>
<div class="login">
    <a href="{:url('/')}" title="首页">
        <img style = 'width: 9rem;
    margin-top: 1rem;'src="__MODULE_IMG__/logo.png">
    </a>
    <ul>
        {notempty name='user'}
        <!--<a href="/account/update/" title="" class="ucter">
            欢迎  {$user.mobile}
        </a>
        <span class="separate">|</span>-->
        <a href="{:url('shop/account/index')}" title="个人中心">个人中心</a>
        <span class="separate">|</span>
        <!--
                        <a href="{:url('shop/account/love')}" title="我的关注">我的关注</a>

                        <span class="separate">|</span>
                        <a href="{:url('shop/artwork/cart')}" title="购物车">购物车</a>
                        <span class="separate">|</span>-->
        <a href="{:url('shop/login/logout')}" title="退出">退出</a>
        {else/}

        <li><a href="{:url('shop/login/index')}" title="登录">登录</a></li>
        <li>|</li>
        <li><a href="{:url('shop/login/register')}" title="注册">注册</a></li>
        {/notempty}
    </ul>
</div>
<?php $account_select="账号管理" ;?>
{include file="public:nav"/}
{include file="public:menu"/}


<div class="inp">
    <p>手机号码：
        <input type="text" id="account" value="" style="">
    </p>

    <p>验证码：
        <input type="text" id="code" value="" style="">
    </p>
    <div id="getcode" class="details" style="    width: 100%;
    height: 3.15rem;
    background: #231916;
    color: #FFFFFF;
    font-size: 1rem;
    text-align: center;
    line-height: 3.15rem;
    margin-top: 1rem;
    border-radius: .25rem;">
        获取验证码
    </div>
    <div id="submit" class="details" style="    width: 100%;margin-top: 1rem;
    height: 3.15rem;
    background: #231916;
    color: #FFFFFF;
    font-size: 1rem;
    text-align: center;
    line-height: 3.15rem;
    margin-top: 1rem;
    border-radius: .25rem;">
        保存
    </div>
</div>

<div class="call">
    <a href="tel:4006667899" style="    color: #fff;"><img src="/static/shop/mobile/img/tel111.png" /></a>
    <a href="tel:4006667899" style="    color: #fff;"><p>收藏热线：400 666 7899</p></a>
</div>

<div class="footer">
    {include file="public:single"/}
</div>
<p class="icp">网站备案号：晋ICP备10002939号</p>
</body>
<script src="/static/shop/account/js/jquery-3.2.1-min.js"></script>
<script src="/static/shop/account/js/PhoneJs.js"></script>

</html>

<script>
    $(document).ready(function () {

        $("#getcode").on("click", function () {
            if(!$("#account").val()){
                return alert('请输入正确的手机号');
            }
            $.ajax({
                url: "{:url('/shop/account/code')}",
                type: "POST",
                data: {
                    number: $("#account").val()
                },
                success: function (data) {
                    alert('发送成功');
                }
            });
        });
        $("#submit").on("click", function () {
            if(!$("#account").val()){
                return alert('请输入正确的手机号');
            }
            $.ajax({
                url: "{:url('/shop/account/ajaxUpdate')}",
                type: "POST",
                dataType: "JSON",
                data: {
                    account: $("#account").val(),
                    code: $("#code").val()
                },
                success: function (data) {
                    alert(data.msg);
                    if (data.code == "1") {
                        window.location.href = "{:url('/shop/account/index')}";
                    }

                }
            });
        });
    });
</script>